# coding=utf-8
"""
author = jamon
"""

import os

if __name__ == "__main__":
    import sys

    parent_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
    sys.path.append(parent_dir)  # 添加项目的根目录到系统路径中

from obespoir.config import Config
from obespoir.websocketserver.route import WebsocketController
from obespoir.server.server import Server
from obespoir.share.espoir_log import EspoirLog

if __name__ == "__main__":
    from config.proxy_1_config import data

    config = Config(data)
    EspoirLog.init_log_config(module_name=config.name, log_dir=config.log_dir,
                              level=config.log_level)

    main_server = Server()
    main_server.register_socket_route(WebsocketController())
    main_server.start(config)
